<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false" %>
<html>
<head>
    <title>岗位列表</title>
   <%@include file="/jsp/public/header.jsp" %>
</head>
<body>
 
<div id="Title_bar">
    <div id="Title_bar_Head">
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 岗位管理
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<div id="MainArea">
    <table cellspacing="0" cellpadding="0" class="TableStyle">
       
        <!-- 表头-->
        <thead>
            <tr align="CENTER" valign="MIDDLE" id="TableTitle">
            	<td width="200px">岗位名称</td>
                <td width="300px">岗位说明</td>
                <td>相关操作</td>
            </tr>
        </thead>

		<!--显示数据列表-->
        <tbody id="TableData" class="dataContainer" datakey="roleList">
        	<c:forEach items="${roleList}" var="role">
				<tr class="TableDetail1 template">
					<td>${role.name}&nbsp;</td>
					<td>${role.description}&nbsp;</td>
                    <%--此处删除的功能可以使用js做个判断然后删除--%>
					<td>
<%--                        <a href="delete.do?id=${role.rid}" namespace="/">删除</a>--%>
                        <a onclick="confirmDeletion(${role.rid})" namespace="/">删除</a>
                        <a href="editUI.do?id=${role.rid}" namespace="/">修改</a>
                        <a href="setPrivilegeUI.do?rid=${role.rid}" namespace="/">设置权限</a>
					</td>
				</tr>
            </c:forEach>
        </tbody>
    </table>
    
    <!-- 其他功能超链接 -->
    <div id="TableTail">
        <div id="TableTail_inside">
            <a href="${pageContext.request.contextPath}/role/addUI.do"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a>
        </div>
        <!--分页信息-->
        <%@include file="/jsp/public/pageView.jsp" %>
    </div>
</div>
<script>
    function confirmDeletion(id) {
        console.log(id);
        if (confirm("是否永久删除此条数据")) {
            window.location = "${pageContext.request.contextPath}/role/delete.do?id=" + id;
        } else {
            console.log(0)
        }
    }
</script>
</body>
</html>

